import { createRouter, createWebHashHistory } from 'vue-router';


const ModulesFile = import.meta.glob('./*/index.js', {eager:true});

let routerArr = [];

routerArr.push({
    path: '/',
    name: 'Home',
    // 按需引入
    component: () => import('components/Home.vue')
})


Object.values(ModulesFile).map(el => {
    if (el.default) {
        routerArr.push(el.default);
    }
});

export default createRouter({
    history: createWebHashHistory(), //路由的模式
    linkExactActiveClass: 'active',  //点击路由跳转的底部样式标量
    routes: routerArr
});
